#pragma once

#define TILE(x,y) (x+(y*32))

enum INPUTEVENTS {
	TOUCH_DOWN,
	TOUCH_UP,
	TOUCH_HELD,
	KEY_B_DOWN,
	KEY_A_DOWN,
	KEY_X_DOWN,
	KEY_Y_DOWN,
	KEY_UP_DOWN,
	KEY_DOWN_DOWN,
	KEY_LEFT_DOWN,
	KEY_RIGHT_DOWN,
	KEY_START_DOWN
};

enum WINDOWOBJECTS {
	OBJ_UNDEF,
	LABEL,
	BUTTON,
	SELECTOR,
	CHECKBOX,
	RADIO
};

enum RDO_RESULT {
	RDO_UNSELECTED,
	RDO_SELECTED
};

enum CHK_RESULT {
	CHK_UNCHECKED,
	CHK_CHECKED
};

enum SEL_RESULT {
	SEL_UNSELECTED,
	SEL_SELECTED,
	SEL_ACTIVATED
};

enum BTN_RESULT {
	BTN_UP,
	BTN_DOWN,
	BTN_ACTIVATED
};

enum WND_RESULT {
	WND_CANCEL,
	WND_IDLE,
	WND_OK,
	WND_SEL
};

typedef struct ICONBUTTONDATA {
	u8 x1; u8 y1;
	u8 x2; u8 y2;
	char title[32];
	u32 icon;
}IconButtonData;

/*typedef struct LABELDATA {
	u8 x1; u8 y1;
	u8 x2; u8 y2;
	u8 type;
	char* title;
}LabelData;

typedef struct BUTTONDATA {
	u8 x1; u8 y1;
	u8 x2; u8 y2;
	u8 type;
	char* title;
}ButtonData;

typedef struct SELECTORDATA {
	u8 x1; u8 y1;
	u8 x2; u8 y2;
	u8 type;
	char* title;
}SelectorData;*/

typedef struct WINDOWDATA {
	u8 x1; u8 y1;
	u8 x2; u8 y2;
	char* title;
}WindowData;

typedef struct GUIDATA {
	u8 x1; u8 y1;
	u8 x2; u8 y2;
	char title[32];
	u32 buffer;
}GUIData;


/*typedef union GUIDATA {
	LabelData labelData;
	ButtonData buttonData;
	SelectorData selectorData;
}GUIData;*/

enum GUITILES {
	BLANK			=128,//START// tiles offset because I had to put it next to the text to save space
	UNDEF1,
	SELECTED,
	TITLE_TOP_LEFT,
	TITLE_TOP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